/*大文件传输测试，给服务器上传一个大文件，服务器将文件保存下来，观察处理结果*/
/*
    上传的文件，和服务器保存的文件一致
*/

#include <iostream>

#include "../source/Server.hpp"
#include "../http/http.hpp"

int main()
{
    TcpSocket client;
    client.BulidClientSocket("127.0.0.1", 8888);
    std::string req = "PUT /1234.txt HTTP/1.1\r\nConnection: keep-alive\r\n";
    std::string body;
    Util::ReadFile("./hello.txt", &body);
    req += "Content-Length: " + std::to_string(body.size()) + "\r\n\r\n";
    assert(client.Send(req) != -1);
    assert(client.Send(body) != -1);
    std::string out;
    out.resize(1024);
    assert(client.Recv(&out));
    DEBUG_LOG("[%s]", out.c_str());
    sleep(15);
    return 0;
}